/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package py.com.sole.model;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author bala
 */
@Entity
@Table(name = "clases")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Clase.findAll", query = "SELECT c FROM Clase c"),
    @NamedQuery(name = "Clase.findById", query = "SELECT c FROM Clase c WHERE c.id = :id"),
    @NamedQuery(name = "Clase.findByDescripcion", query = "SELECT c FROM Clase c WHERE c.descripcion = :descripcion"),
    @NamedQuery(name = "Clase.findByFecha", query = "SELECT c FROM Clase c WHERE c.fecha = :fecha"),
    @NamedQuery(name = "Clase.findByHoraInicio", query = "SELECT c FROM Clase c WHERE c.horaInicio = :horaInicio"),
    @NamedQuery(name = "Clase.findByHoraFin", query = "SELECT c FROM Clase c WHERE c.horaFin = :horaFin"),
    @NamedQuery(name = "Clase.findByConfirmAlumno", query = "SELECT c FROM Clase c WHERE c.confirmAlumno = :confirmAlumno"),
    @NamedQuery(name = "Clase.findByConfirmProfesor", query = "SELECT c FROM Clase c WHERE c.confirmProfesor = :confirmProfesor")})
public class Clase implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(nullable = false)
    private Integer id;
    @Column(length = 45)
    private String descripcion;
    @Basic(optional = false)
    @Column(nullable = false)
    @Temporal(TemporalType.DATE)
    private Date fecha;
    @Basic(optional = false)
    @Column(name = "hora_inicio", nullable = false)
    @Temporal(TemporalType.TIME)
    private Date horaInicio;
    @Basic(optional = false)
    @Column(name = "hora_fin", nullable = false)
    @Temporal(TemporalType.TIME)
    private Date horaFin;
    @Basic(optional = false)
    @Column(name = "confirm_alumno", nullable = false)
    private short confirmAlumno;
    @Basic(optional = false)
    @Column(name = "confirm_profesor", nullable = false)
    private short confirmProfesor;
    @JoinColumn(name = "profesore", referencedColumnName = "id", nullable = false)
    @ManyToOne(optional = false)
    private Profesor profesore;
    @JoinColumn(name = "materia", referencedColumnName = "id", nullable = false)
    @ManyToOne(optional = false)
    private Materia materia;
    @JoinColumn(name = "estados", referencedColumnName = "id", nullable = false)
    @ManyToOne(optional = false)
    private Estado estados;
    @JoinColumn(name = "alumno", referencedColumnName = "id", nullable = false)
    @ManyToOne(optional = false)
    private Alumno alumno;

    public Clase() {
    }

    public Clase(Integer id) {
        this.id = id;
    }

    public Clase(Integer id, Date fecha, Date horaInicio, Date horaFin, short confirmAlumno, short confirmProfesor) {
        this.id = id;
        this.fecha = fecha;
        this.horaInicio = horaInicio;
        this.horaFin = horaFin;
        this.confirmAlumno = confirmAlumno;
        this.confirmProfesor = confirmProfesor;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public Date getFecha() {
        return fecha;
    }

    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

    public Date getHoraInicio() {
        return horaInicio;
    }

    public void setHoraInicio(Date horaInicio) {
        this.horaInicio = horaInicio;
    }

    public Date getHoraFin() {
        return horaFin;
    }

    public void setHoraFin(Date horaFin) {
        this.horaFin = horaFin;
    }

    public short getConfirmAlumno() {
        return confirmAlumno;
    }

    public void setConfirmAlumno(short confirmAlumno) {
        this.confirmAlumno = confirmAlumno;
    }

    public short getConfirmProfesor() {
        return confirmProfesor;
    }

    public void setConfirmProfesor(short confirmProfesor) {
        this.confirmProfesor = confirmProfesor;
    }

    public Profesor getProfesore() {
        return profesore;
    }

    public void setProfesore(Profesor profesore) {
        this.profesore = profesore;
    }

    public Materia getMateria() {
        return materia;
    }

    public void setMateria(Materia materia) {
        this.materia = materia;
    }

    public Estado getEstados() {
        return estados;
    }

    public void setEstados(Estado estados) {
        this.estados = estados;
    }

    public Alumno getAlumno() {
        return alumno;
    }

    public void setAlumno(Alumno alumno) {
        this.alumno = alumno;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Clase)) {
            return false;
        }
        Clase other = (Clase) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "py.com.sole.model.Clase[ id=" + id + " ]";
    }
       
    
    
}
